//
//  DefaultTextCellData.m
//  18Birdies
//
//  Created by Lc on 15/7/21.
//  Copyright (c) 2015年 Lc. All rights reserved.
//

#import "DefaultTextCell.h"
#import "DefaultTextCellData.h"

@implementation DefaultTextCellData

+ (DefaultTextCellData*)cellData {
  DefaultTextCellData* cellData = [[self alloc] init];
  cellData.textTopMargin = 130;
  cellData.textAlignment = NSTextAlignmentCenter;
  return cellData;
}

- (instancetype)init {
  self = [super init];
  if (self) {
    self.textAlignment = NSTextAlignmentCenter;
    self.textTopMargin = 130;
  }
  return self;
}

- (Class)cellClazz {
  return DefaultTextCell.class;
}

- (NSString*)nibName {
  return @"DefaultTextCell";
}

- (void)refreshCell:(DefaultTextCell*)cell {
  [super refreshCell:cell];
  if (self.text.length > 0) {
    cell.hintLabel.attributedText= nil;
    cell.hintLabel.text = self.text;
  } else {
    cell.hintLabel.text = nil;
    cell.hintLabel.attributedText = self.attributedText;
  }
  cell.hintLabel.textAlignment = self.textAlignment;
  cell.hintTopMargin.constant = self.textTopMargin;
  [self setNeedRefreshCellHeight];
}

@end
